#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main()
{
    int a = 0;
    int b = 0;
    char c = '0';
    double d = 0;
    double p = 0;
    double num = 0;
    scanf("%d %d %c", &a, &b, &c);
    if (c == 'm')
        d = 0.05;
    else
        d = 0.03;
    switch (b)
    {
    case 90:
        p = 6.95;
        break;
    case 93:
        p = 7.44;
        break;
    case 97:
        p = 7.93;
        break;
    }
    num = (a * d) * p;
    printf("%.2f",num);
    return 0;
}